home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 30 / PC Gamer IT CD 30 1-2.iso / MOTS / GAMEDATA / RESOURCE / JKMRES.GOO / cog_00_securitycam.cog < prev    next >
Text File  |  1998-02-25  |  1KB  |  65 lines

  1. # Jedi Knight Cog Script
  2. #
  3. # 00_SECURITYCAM.COG
  4. #
  5. # Security camera cog.
  6. #
  7. # [YB]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10.  
  11.  
  12. symbols
  13.  
  14. thing       camera
  15.  
  16. int         player                        local
  17. int         triggerNum=10001              local
  18. int         active=1                      local
  19. vector      cameraPos                     local
  20.  
  21.  
  22. message     startup
  23. message     killed
  24. message     pulse
  25.  
  26. end
  27.  
  28. # ========================================================================================
  29.  
  30. code
  31.  
  32. startup:
  33.    player = GetLocalPlayerThing();
  34.    cameraPos = GetThingPos(camera);
  35.  
  36.    SetPulse(1.0);
  37.  
  38.    Return;
  39.  
  40. # ........................................................................................
  41.  
  42. killed:
  43.    SetPulse(0.0);
  44.    active = 0;
  45.  
  46.    Return;
  47.  
  48. # ........................................................................................
  49.  
  50. pulse:
  51.    if(!active) Return;
  52.  
  53.    if(FirstThingInView(camera, 60, 5.0, 0x400) != -1)
  54.    {
  55.       // Send a TRIGGER_SECURITY with its parameters (the camera who saw him)
  56.       if(VectorDist(cameraPos, GetThingPos(player)) < 2.0)
  57.          SendTrigger(-1, triggerNum, camera, 0, 0, 0);
  58.    }
  59.  
  60.    Return;
  61.  
  62. end
  63.  
  64.  
  65.